Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated BaseOutputHandler to accept state attributes - Tensorboard #2137

Merged
merged 18 commits into from
Aug 8, 2021

Conversation

Ishan-Kumar2
Copy link
Contributor

@Ishan-Kumar2 Ishan-Kumar2 commented Aug 4, 2021

Addresses #2100 (using "fixes" will close the issue)

Description:

Adds feature to log state attributes in Tensorboard

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added the module: contrib Contrib module label Aug 4, 2021
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @Ishan-Kumar2 !
Looks good. I have a suggestion to remove TrainerStateHandler and put the new arg to OutputHandler.

ignite/contrib/handlers/tensorboard_logger.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ishan-Kumar2 thanks for the update ! I liked the way you handled data type dispatch and I left a comment on how we could improve our loggers.

ignite/contrib/handlers/tensorboard_logger.py Outdated Show resolved Hide resolved
ignite/contrib/handlers/base_logger.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @Ishan-Kumar2
There few issues with docstrings otherwise, looks good.

ignite/contrib/handlers/base_logger.py Outdated Show resolved Hide resolved
@@ -179,12 +179,9 @@ class OutputHandler(BaseOutputHandler):
Examples:

.. code-block:: python

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these modifications are wrong, take a look how it is rendered now: https://deploy-preview-2137--pytorch-ignite-preview.netlify.app/generated/ignite.contrib.handlers.tensorboard_logger.html#ignite.contrib.handlers.tensorboard_logger.OutputHandler

Let's also update line 177:

- Helper handler to log engine's output and/or metrics
+ Helper handler to log engine's output, engine's state attributes and/or metrics

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line 182 shouldn't be deleted. That's why the docstring is wrongly rendered.

ignite/contrib/handlers/tensorboard_logger.py Outdated Show resolved Hide resolved
ignite/contrib/handlers/tensorboard_logger.py Outdated Show resolved Hide resolved
ignite/contrib/handlers/tensorboard_logger.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Ishan-Kumar2

@vfdev-5 vfdev-5 merged commit c22285e into pytorch:master Aug 8, 2021
@Ishan-Kumar2 Ishan-Kumar2 deleted the log_states_tensorboard branch August 9, 2021 03:33
@vfdev-5
Copy link
Collaborator

vfdev-5 commented Aug 9, 2021

@Ishan-Kumar2 I forgot to ask you to add .. versionchanged:: as explained here: https://github.com/pytorch/ignite/blob/master/CONTRIBUTING.md#writing-documentation . See as example here:

.. versionchanged:: 0.5.0
`attach` now accepts an optional argument `name`

Please send a PR with a fix.

By the way, would you like to update other loggers ?

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Aug 10, 2021

@Ishan-Kumar2 can you address this comment please for TB and Visdom. Yesterday I also forgot to ask about that. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: contrib Contrib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants